import config from "@/config";
import http from "@/utils/request";

export default {
	ver: {
		url: `${config.API_URL}/demo/ver`,
		name: "获取最新版本号",
		get: async function (params) {
			//var result = await http.get(this.url, params);
			console.log(params);
			// eslint-disable-next-line no-debugger
			//debugger
			var result = {
				code: 200,
				message: "",
				data:"1.6.6"
			};
			return result;
		},
	},
	post: {
		url: `${config.API_URL}/demo/post`,
		name: "分页列表",
		post: async function (data) {
			console.log(data);
			// var result = await http.post(this.url, data, {
			// 	headers: {
			// 		//'response-status': 401
			// 	},
			// });
			// eslint-disable-next-line no-debugger
			//debugger
			var result = {
				code: 200,
				message: "",
				data: "7032364496129942"
			};
			return result;
		},
	},
	page: {
		url: `${config.API_URL}/demo/page`,
		name: "分页列表",
		get: async function (params) {
			//var result = await http.get(this.url, params);
			console.log(params);
			// eslint-disable-next-line no-debugger
			
			var result = {
				code: 200,
				message: "",
				data: {
					"total": 41,
					"rows": [
						{
							"id": "410000199512025445",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "401",
							"cip": "95.214.92.71",
							"user": "魏磊",
							"time": "2012-09-05 18:08:06"
						},
						{
							"id": "520000198407304275",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "500",
							"cip": "129.166.168.115",
							"user": "史平",
							"time": "1993-08-25 05:08:41"
						},
						{
							"id": "230000199511014097",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "200",
							"cip": "186.160.119.210",
							"user": "于杰",
							"time": "1998-02-09 13:42:41"
						},
						{
							"id": "990000197205236780",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "POST",
							"code": "401",
							"cip": "193.14.94.222",
							"user": "田娟",
							"time": "2009-11-05 12:37:58"
						},
						{
							"id": "640000200911201176",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "500",
							"cip": "12.69.226.121",
							"user": "邵涛",
							"time": "1989-08-25 05:33:06"
						},
						{
							"id": "710000198709077149",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "500",
							"cip": "116.42.15.149",
							"user": "魏娟",
							"time": "2008-09-07 10:35:41"
						},
						{
							"id": "360000197302144442",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "500",
							"cip": "239.114.89.252",
							"user": "何敏",
							"time": "2016-07-14 20:41:53"
						},
						{
							"id": "500000199407048831",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "401",
							"cip": "95.203.182.52",
							"user": "傅刚",
							"time": "1995-03-09 23:53:50"
						},
						{
							"id": "450000198307033289",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "500",
							"cip": "60.137.195.112",
							"user": "康伟",
							"time": "1970-01-13 19:18:19"
						},
						{
							"id": "220000200908305857",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "POST",
							"code": "500",
							"cip": "106.167.1.227",
							"user": "何秀英",
							"time": "1976-01-01 14:27:22"
						},
						{
							"id": "450000201411302578",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "401",
							"cip": "241.235.41.98",
							"user": "吴涛",
							"time": "2003-10-22 18:03:07"
						},
						{
							"id": "81000020100227047X",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "200",
							"cip": "120.218.167.233",
							"user": "毛军",
							"time": "1983-12-27 22:13:35"
						},
						{
							"id": "420000198411242296",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "500",
							"cip": "123.130.209.70",
							"user": "张霞",
							"time": "2008-06-17 01:36:50"
						},
						{
							"id": "460000201605269026",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "POST",
							"code": "500",
							"cip": "79.243.107.181",
							"user": "段超",
							"time": "1980-01-16 19:59:55"
						},
						{
							"id": "610000200506056280",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "POST",
							"code": "200",
							"cip": "14.23.92.219",
							"user": "宋涛",
							"time": "1986-10-19 11:28:05"
						},
						{
							"id": "370000197405268159",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "POST",
							"code": "500",
							"cip": "233.81.94.91",
							"user": "石勇",
							"time": "2012-04-29 21:58:34"
						},
						{
							"id": "440000200407105727",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "POST",
							"code": "200",
							"cip": "178.29.69.222",
							"user": "贾超",
							"time": "1989-09-28 16:26:08"
						},
						{
							"id": "45000019760731722X",
							"name": "用户登录",
							"url": "/oauth/token",
							"type": "GET",
							"code": "500",
							"cip": "117.35.28.120",
							"user": "汤强",
							"time": "1975-05-24 14:29:46"
						}
					]
				}
			};
			return result;
		},
	},
	list: {
		url: `${config.API_URL}/demo/list`,
		name: "数据列表",
		get: async function (params) {
			console.log(params);
			//var result = await http.get(this.url, params);
			// eslint-disable-next-line no-debugger
			//debugger
			var result = {
				code: 200,
				message: "",
				data:{
					"total": 5,
					"page": 1,
					"pageSize": 20,
					"summary": {
						"num": "999.00",
						"progress": "888.00"
					},
					"rows": [
						{
							"id": "21000019960729400X",
							"name": "Donna Martinez",
							"email": "j.ugyxgmwks@npiy.fj",
							"ip": "91.112.211.203",
							"datetime": "1983-05-21 18:24:40",
							"boolean": false,
							"type": "1",
							"sex": "女",
							"progress": 49,
							"num": 288
						},
						{
							"id": "230000200202121556",
							"name": "William Lopez",
							"email": "i.ihcssrr@qkrsmyk.fi",
							"ip": "93.61.220.121",
							"datetime": "1980-11-18 08:50:28",
							"boolean": false,
							"type": "0",
							"sex": "男",
							"progress": 70,
							"num": 44
						},
						{
							"id": "370000198305140005",
							"name": "Amy Johnson",
							"email": "x.ldbgm@kintfesdf.no",
							"ip": "33.57.122.121",
							"datetime": "1982-11-05 17:48:48",
							"boolean": false,
							"type": "0",
							"sex": "男",
							"progress": 85,
							"num": 207
						},
						{
							"id": "620000197102030671",
							"name": "John Martinez",
							"email": "b.mjqywh@udgreef.bh",
							"ip": "242.53.112.195",
							"datetime": "1979-11-16 15:45:08",
							"boolean": true,
							"type": "0",
							"sex": "男",
							"progress": 72,
							"num": 725
						},
						{
							"id": "450000198609278804",
							"name": "John Johnson",
							"email": "i.aymo@osvnrlyd.cz",
							"ip": "231.217.211.27",
							"datetime": "2014-12-23 16:16:04",
							"boolean": false,
							"type": "0",
							"sex": "男",
							"progress": 43,
							"num": 967
						}
					]
				}
			};
			return result;
		},
	},
	menu: {
		url: `${config.API_URL}/demo/menu`,
		name: "普通用户菜单",
		get: async function () {
			var result = await http.get(this.url);
			// eslint-disable-next-line no-debugger
			//debugger
			return result;
		},
	},
	status: {
		url: `${config.API_URL}/demo/status`,
		name: "模拟无权限",
		get: async function (code) {
			return await http.get(
				this.url,
				{},
				{
					headers: {
						"response-status": code,
					},
				}
			);
		},
	},
};
